﻿#ifndef CAPSTATUSWIDGET_H
#define CAPSTATUSWIDGET_H

#include <QWidget>
#include <QTableWidget>
#include <QGridLayout>
#include <QHeaderView>
#include <QLabel>
#include <QCheckBox>
#include <QFile>
#include <QDateTime>
#include <QApplication>
#include "capcontrol/capcontroldefine.h"



class QCapStatusWidget : public QWidget
{
    Q_OBJECT
public:
    explicit QCapStatusWidget(QWidget *parent = nullptr);

signals:

public slots:

    void onRcvData(QVariant var);

    void onSaveDataFileCheck();

private:
    void showRcvData();
    void showRcv11Data();


    void InitRcvDataTabelwidget();

    QString parseAzimuthInfo(uchar data);//方位遥测信息
    QString parsePitchInfo(uchar data);   //俯仰遥测信息
    QString parseCmdRcvStatus(uchar data);   //指令接收状态
    QString parseCmdProcStatus(uchar data);   //指令执行状态

    void writeDataToFile(QString str);

    QTableWidget* _pRcvDataTableWidget;
    QCheckBox* _pSaveDataFileCheckBox;


    st_rcvdata _rcv_capdata;

    QMap<int,QString> _cmdProcStatusMap;

    int _i32FrameCnt;
    int _i32Frame11Cnt;

    QFile m_savefile;

    QString m_sRcvData;
    bool m_bSaveFile;

};

#endif // CAPSTATUSWIDGET_H
